package com.miracle.main.module.mvp.contract;

import com.miracle.basemvp.base.IModel;
import com.miracle.basemvp.base.IView;
import com.miracle.common.mvp.entity.request.CheckVersionRequest;
import com.miracle.common.mvp.entity.response.DandelionResponse;
import com.miracle.common.mvp.entity.response.VersionInfo;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.ResponseBody;

/**
 * com.miracle.main.module.mvp.contract
 * (c)2018 AIR Times Inc. All rights reserved.
 *
 *
 * @author WangJQ
 * @version 1.0
 * @date 2018/7/7 13:25
 * @see com.miracle.main.module.mvp.contract
 */
public interface SettingContract {
    interface Model extends IModel {
        /**
         * 检查版本号
         * @param request
         * @return
         */
        Observable<DandelionResponse<VersionInfo>> checkVersion(CheckVersionRequest request);

        /**
         * 下载apk
         * @return
         */
        Observable<ResponseBody> downloadApk();

        /**
         * 上传文件
         * @param url
         * @param body
         * @param session
         * @return
         */
        Observable<ResponseBody> uploadFiles(String url, MultipartBody body, String session);
    }

    interface View extends IView {
        /**
         * 发现新版本
         */
        void FindANewVersion(String msg);

        /**
         * 没有新版本
         */
        void NoNewVersion();

        /**
         * 上传头像成功
         * @param url
         */
        void onUploadSucc(String url);

        /**
         * 上传 头像失败
         * @param msg
         */
        void onUpLoadFail(String msg);
    }
}
